package com.bak;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;

public class ResourceManager {
    public static BufferedImage goodTankL, goodTankU, goodTankR, goodTankD;
    public static BufferedImage badTankL, badTankU, badTankR, badTankD;

    public static BufferedImage tankU, tankD, tankL, tankR, tankLD, tankLU, tankRD, tankRU;
    public static BufferedImage bulletU, bulletD, bulletL, bulletR, bulletLD, bulletLU, bulletRD, bulletRU;

    public static BufferedImage[] explodes = new BufferedImage[16];

    static {

        try {
            tankU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankU.gif"));
            tankD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankD.gif"));
            tankL = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankL.gif"));
            tankR = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankR.gif"));
            tankLD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankLD.gif"));
            tankLU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankLU.gif"));
            tankRD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankRD.gif"));
            tankRU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/tankRU.gif"));

            bulletU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/bulletD.gif"));
            bulletD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/bulletD.gif"));
            bulletL = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/bulletL.gif"));
            bulletR = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/bulletR.gif"));
            bulletLD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/missileLD.gif"));
            bulletLU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/missileLU.gif"));
            bulletRD = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/missileRD.gif"));
            bulletRU = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/missileRU.gif"));

            for (int i = 0; i < 16; i++)
                explodes[i] = ImageIO.read(ResourceManager.class.getClassLoader().getResourceAsStream("images/e" + (i + 1) + ".gif"));

        } catch (IOException e) {
            e.printStackTrace();
        }


    }


}
